package eu.robico.simulator.simulatorinterface.actionpanel.objects;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;

import eu.robico.simulator.simulatorinterface.actionpanel.Position;

class ColorLaneObject implements ActionPanelObject
{
	private Position startPosition, endPosition;
	private int width = 20;
	
	public ColorLaneObject(Position startPosition, Position endPosition)
	{
		this.startPosition = startPosition;
		this.endPosition = endPosition;
	}
	
	public void setWidth(int width)
	{
		this.width = width;
	}
	
	public Position getStartPosition()
	{
		return startPosition;
	}
	
	public Position getEndPosition()
	{
		return endPosition;
	}
	
	public int getWidth()
	{
		return width;
	}
	
	@Override
	public void paint(Graphics2D graphics) 
	{
		graphics.setColor(Color.WHITE);
		graphics.setStroke(new BasicStroke(width));
		graphics.drawLine(startPosition.xAsInt(), startPosition.yAsInt(), endPosition.xAsInt(), endPosition.yAsInt());
	}
	

}
